const userMsg = localStorage.getItem("userMsg") ? JSON.parse(localStorage.getItem("userMsg")) : {};
export default {
  state(){
    return {
      token: userMsg.token || "",
      power: userMsg.power,
      tId: userMsg.tId,
      uId: userMsg.uId,
      uName: userMsg.uName || ""
    }
  },
  mutations:{
    change_token(state, payload){
      state.token = payload;
    },
    change_power(state, payload){
      state.power = payload;
    },
    change_tId(state, payload){
      state.tId = payload;
    },
    change_uId(state, payload){
      state.uId = payload;
    },
    change_uName(state, payload){
      state.uName = payload;
    }
  },
  namespaced: "user"
}